package com.eonmind.pay;

import cn.hutool.core.lang.hash.Hash;
import com.eonmind.common.provider.entity.vip.VipPackage;
import com.mongoplus.annotation.MongoMapperScan;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @ClassName PayApplication
 * @Description TODO
 * Author 32004
 * Date 2025/4/26 21:54
 * Version 1.0
 **/

@Slf4j
@EnableFeignClients(basePackages = {"com.eonmind"})
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = {"com.eonmind.pay", "com.eonmind.common"})
@MongoMapperScan("com.eonmind.pay.mapper")
@EnableScheduling
public class PayApplication {

    public static HashMap<Long, VipPackage> vipMap = new HashMap<>();

    static {


        VipPackage vip1 = new VipPackage();
        vip1.setId(1L);
        vip1.setCode("explorer_3day");
        vip1.setName("资源探索家-3日卡");
        vip1.setCategory(2);
        vip1.setTier(1);
        vip1.setOriginalPrice(0.1);
        vip1.setCurrentPrice(0.1);
        vip1.setCurrency("CNY");
        vip1.setDiscount(0);
        vip1.setDailyCoins(100000);
        vip1.setDuration(3);
        vip1.setDescription("无限使用对话、绘画");

        VipPackage vip2 = new VipPackage();
        vip2.setId(2L);
        vip2.setCode("searcher_monthly");
        vip2.setName("资讯搜索家-月卡");
        vip2.setCategory(2);
        vip2.setTier(2);
        vip2.setOriginalPrice(99.97);
        vip2.setCurrentPrice(49.98);
        vip2.setCurrency("CNY");
        vip2.setDiscount(50);
        vip2.setDailyCoins(100000);
        vip2.setDuration(30);
        vip2.setDescription("无限使用对话、绘画");

        VipPackage vip3 = new VipPackage();
        vip3.setId(3L);
        vip3.setCode("searcher_yearly");
        vip3.setName("资讯搜索家-年卡");
        vip3.setCategory(2);
        vip3.setTier(3);
        vip3.setOriginalPrice(1199.97);
        vip3.setCurrentPrice(299.99);
        vip3.setCurrency("CNY");
        vip3.setDiscount(75);
        vip3.setDailyCoins(100000);
        vip3.setDuration(365);
        vip3.setDescription("无限使用对话、绘画");

        VipPackage vip4 = new VipPackage();
        vip4.setId(4L);
        vip4.setCode("dimension_lord_monthly");
        vip4.setName("次元领主-月卡");
        vip4.setCategory(2);
        vip4.setTier(2);
        vip4.setOriginalPrice(249.97);
        vip4.setCurrentPrice(99.99);
        vip4.setCurrency("CNY");
        vip4.setDiscount(60);
        vip4.setDailyCoins(250000);
        vip4.setDuration(30);
        vip4.setDescription("大量音乐、视频、P");

        VipPackage vip5 = new VipPackage();
        vip5.setId(5L);
        vip5.setCode("dimension_lord_yearly");
        vip5.setName("次元领主-年卡");
        vip5.setCategory(2);
        vip5.setTier(3);
        vip5.setOriginalPrice(2999.97);
        vip5.setCurrentPrice(599.99);
        vip5.setCurrency("CNY");
        vip5.setDiscount(80);
        vip5.setDailyCoins(250000);
        vip5.setDuration(365);
        vip5.setDescription("大量音乐、视频、P");

        VipPackage vip6 = new VipPackage();
        vip6.setId(6L);
        vip6.setCode("top_up_3day");
        vip6.setName("加油包");
        vip6.setCategory(1);
        vip6.setTier(1);
        vip6.setOriginalPrice(9.99);
        vip6.setCurrentPrice(9.99);
        vip6.setCurrency("CNY");
        vip6.setDiscount(0);
        vip6.setDailyCoins(0);
        vip6.setDuration(3);
        vip6.setDescription("加油包-3天有效期");

        VipPackage vip7 = new VipPackage();
        vip7.setId(7L);
        vip7.setCode("top_up_7day");
        vip7.setName("特惠加油包");
        vip7.setCategory(1);
        vip7.setTier(1);
        vip7.setOriginalPrice(99.99);
        vip7.setCurrentPrice(99.99);
        vip7.setCurrency("CNY");
        vip7.setDiscount(0);
        vip7.setDailyCoins(0);
        vip7.setDuration(7);
        vip7.setDescription("加油包-7天有效期");

        vipMap.put(vip1.getId(), vip1);
        vipMap.put(vip2.getId(), vip2);
        vipMap.put(vip3.getId(), vip3);
        vipMap.put(vip4.getId(), vip4);
        vipMap.put(vip5.getId(), vip5);
        vipMap.put(vip6.getId(), vip6);
        vipMap.put(vip7.getId(), vip7);

        // Print the HashMap
        for (Map.Entry<Long, VipPackage> entry : vipMap.entrySet()) {
            System.out.println("ID: " + entry.getKey() + ", Vip: " + entry.getValue());
        }
    }


    public static void main(String[] args) {
        SpringApplication.run(PayApplication.class, args);
    }
}
